package com.blb.service.impl;

import com.blb.entity.User;
import com.blb.mapper.UserMapper;
import com.blb.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author HuaHao
 * @since 2019-11-15
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Resource
    private UserMapper userMapper;


    @Override
    public User getUserByUsername(String userName) {
        return userMapper.getUserByUsername(userName);
    }

   @Override
   public void update(String id) {
        userMapper.update(id);
   }

    @Override
    public Set<String> getRoleByUserName(String userName) {
        return userMapper.getRoleByUserName(userName);
    }


    @Override
    public Map<String, Object> getUserAndCompanyByUser(String userId) {
        return userMapper.getUserAndCompanyByUser(userId);
    }

    @Override
    public Set<String> getMenusByUserName(String userName) {
        return userMapper.getMenusByUserName(userName);
    }

    @Override
    public Set<String> getAllMenusToManage() {
        return userMapper.getAllMenusToManage();
    }


}
